home *** CD-ROM | disk | FTP | other *** search
/ Aminet 19 / Aminet 19 (1997)(GTI - Schatztruhe)[!][Jun 1997].iso / Aminet / dev / misc / RenderLib.lha / RenderLib / Include / render / render.h next >
Encoding:
C/C++ Source or Header  |  1997-03-24  |  8.1 KB  |  273 lines

  1. #ifndef RENDER_H
  2. #define RENDER_H
  3. /*
  4. **    $VER: render.h 18.0 (24.2.97)
  5. **
  6. **    render.library definitions
  7. **
  8. **    © 1996 TEK neosçientists
  9. */
  10.  
  11.  
  12.  
  13. #ifndef UTILITY_TAGITEM_H
  14. #include <utility/tagitem.h>
  15. #endif
  16.  
  17.  
  18.  
  19. #define    RND_TAGBASE    (TAG_USER+0x1000)
  20.  
  21.  
  22. /************************************************************************
  23.  
  24.     memhandler
  25.  
  26. ************************************************************************/
  27.  
  28. #define    RND_MemType        (RND_TAGBASE+1)        /* type of memhandler, see below */
  29. #define    RND_MemBlock    (RND_TAGBASE+2)        /* ptr to block of memory */
  30. #define    RND_MemSize        (RND_TAGBASE+3)        /* size of memblock [bytes] */
  31. #define    RND_MemFlags    (RND_TAGBASE+18)    /* memflags (exec/memory.h) */
  32. #define    RND_RMHandler    (RND_TAGBASE+12)    /* to pass a memhandler as an argument */
  33.  
  34. /*
  35.  *    memhandler types
  36.  */
  37.  
  38. #define    RMHTYPE_POOL        1                /* v39 exec dynamic pool */
  39. #define    RMHTYPE_PRIVATE        2                /* private memory pool */
  40. #define    RMHTYPE_PUBLIC        3                /* common public memory */
  41.  
  42.  
  43. /************************************************************************
  44.  
  45.     palette
  46.  
  47. ************************************************************************/
  48.  
  49. #define    RND_PaletteFormat    (RND_TAGBASE+19)    /* palette import/export format */
  50. #define    RND_EHBPalette        (RND_TAGBASE+22)    /* tag to indicate a palette is EHB */
  51. #define    RND_FirstColor        (RND_TAGBASE+23)    /* first palette entry */
  52. #define RND_NewPalette        (RND_TAGBASE+24)    /* dispose the old palette and load a new one */
  53. #define    RND_RGBWeight        (RND_TAGBASE+11)    /* quantization factors */
  54.  
  55. /*
  56.  *    palette format types
  57.  */
  58.  
  59. #define    PALFMT_RGB32        1                    /* ULONG red,green,blue */
  60. #define PALFMT_RGB8            2                    /* ULONG 0x00rrggbb */
  61. #define    PALFMT_RGB4            3                    /* UWORD 0xrgb */
  62.  
  63. /*
  64.  *    palette sort mode types
  65.  *    for the use with SortPalette()
  66.  */
  67.  
  68.     /* no particular order */
  69. #define    PALMODE_NONE            0x0000
  70.  
  71.     /* sort palette entries by brightness */
  72. #define    PALMODE_BRIGHTNESS        0x0001
  73.  
  74.     /* sort palette entries by the number of pixels that they represent.
  75.        You must supply the RND_Histogram taglist argument. */
  76. #define    PALMODE_POPULARITY        0x0002
  77.  
  78.     /* sort palette entries by the number of histogram entries that they
  79.        represent. You must supply the RND_Histogram taglist argument. */
  80. #define    PALMODE_REPRESENTATION    0x0003
  81.  
  82.     /* sort palette entries by their optical significance for the human
  83.        eye. Implementation is unknown to you and may change.
  84.        You must supply the RND_Histogram taglist argument. */
  85. #define PALMODE_SIGNIFICANCE    0x0004
  86.  
  87.     /* sort palette entries by color intensity */
  88. #define    PALMODE_SATURATION        0x0005
  89.  
  90.     /* By default, sort direction is descending, i.e. the precedence is
  91.        more-to-less. Combine with this flag to invert the sort direction. */
  92. #define    PALMODE_ASCENDING        0x0008
  93.  
  94.  
  95. /************************************************************************
  96.  
  97.     histogram related
  98.  
  99. ************************************************************************/
  100.  
  101. #define    RND_HSType            (RND_TAGBASE+4)        /* histogram type, see below */
  102. #define    RND_Histogram        (RND_TAGBASE+9)        /* to pass a histogram to be passed */
  103.  
  104. /*
  105.  *    Histogram / Palette types
  106.  *    to be specified with RND_HSType
  107.  */
  108.  
  109. #define    HSTYPE_12BIT        4                    /* 12bit dynamic histogram */
  110. #define    HSTYPE_15BIT        5                    /* 15bit dynamic histogram */
  111. #define    HSTYPE_18BIT        6                    /* 18bit dynamic histogram */
  112. #define    HSTYPE_21BIT        7                    /* 21bit dynamic histogram */
  113. #define    HSTYPE_24BIT        8                    /* 24bit dynamic histogram */
  114. #define    HSTYPE_12BIT_TURBO    20                    /* 12bit tabular histogram */
  115. #define    HSTYPE_15BIT_TURBO    21                    /* 15bit tabular histogram */
  116. #define    HSTYPE_18BIT_TURBO    22                    /* 18bit tabular histogram */
  117.  
  118. /*
  119.  *    tags that can be queried via QueryHistogram()
  120.  */
  121.  
  122. #define    RND_NumPixels        (RND_TAGBASE+5)        /* # pixels in a histogram */
  123. #define    RND_NumColors        (RND_TAGBASE+6)        /* # colors in a histogram */
  124.  
  125.  
  126. /************************************************************************
  127.  
  128.     rendering and conversions
  129.  
  130. ************************************************************************/
  131.  
  132. #define    RND_ColorMode        (RND_TAGBASE+7)        /* color mode, see below */
  133. #define    RND_DitherMode        (RND_TAGBASE+8)        /* dither mode, see below */
  134. #define    RND_DitherAmount    (RND_TAGBASE+26)    /* dither amount */
  135. #define    RND_OffsetColorZero    (RND_TAGBASE+10)    /* first color index to be output */
  136.  
  137. /*
  138.  *    color mode types
  139.  *    to be specified with RND_ColorMode
  140.  */
  141.  
  142. #define    COLORMODE_CLUT        0x0000                /* normal palette lookup */
  143. #define    COLORMODE_HAM8        0x0001                /* HAM8 mode */
  144. #define    COLORMODE_HAM6        0x0002                /* HAM6 mode */
  145. #define    COLORMODE_MASK        0x0003                /* mask to determine COLORMODE */
  146.  
  147. /*
  148.  *    dither mode types
  149.  *    to be specified with RND_DitherMode
  150.  */
  151.  
  152. #define    DITHERMODE_NONE        0x0000                /* no dither */
  153. #define    DITHERMODE_FS        0x0001                /* Floyd-Steinberg dither */
  154. #define    DITHERMODE_RANDOM    0x0002                /* random dither. amount required. */
  155.  
  156.  
  157. /************************************************************************
  158.  
  159.     miscellaneous
  160.  
  161. ************************************************************************/
  162.  
  163. #define    RND_ProgressHook    (RND_TAGBASE+13)    /* progress callback hook */
  164. #define    RND_SourceWidth        (RND_TAGBASE+14)    /* total input width [pixels] */
  165. #define    RND_DestWidth        (RND_TAGBASE+15)    /* total output width [pixels] */
  166. #define    RND_PenTable        (RND_TAGBASE+16)    /* ptr to a chunky conversion table */
  167. #define    RND_LeftEdge        (RND_TAGBASE+17)    /* chunky data left edge [pixels] */
  168. #define    RND_LineHook         (RND_TAGBASE+20)    /* line callback hook */
  169.  
  170.  
  171. /************************************************************************
  172.  
  173.     PixelFormat
  174.  
  175. ************************************************************************/
  176.  
  177. #define    RND_PixelFormat    (RND_TAGBASE+25)        /* pixel format, see below */
  178.  
  179. #define    PIXFMTB_CHUNKY        3
  180. #define    PIXFMTB_BITMAP        4
  181. #define    PIXFMTB_RGB            5
  182.  
  183. #define    PIXFMT_CHUNKY_CLUT    ((1L << PIXFMTB_CHUNKY) + COLORMODE_CLUT)
  184. #define    PIXFMT_CHUNKY_HAM8    ((1L << PIXFMTB_CHUNKY) + COLORMODE_HAM8)
  185. #define    PIXFMT_CHUNKY_HAM6    ((1L << PIXFMTB_CHUNKY) + COLORMODE_HAM6)
  186.  
  187. #define    PIXFMT_BITMAP_CLUT    ((1L << PIXFMTB_BITMAP) + COLORMODE_CLUT)
  188. #define    PIXFMT_BITMAP_HAM8    ((1L << PIXFMTB_BITMAP) + COLORMODE_HAM8)
  189. #define    PIXFMT_BITMAP_HAM6    ((1L << PIXFMTB_BITMAP) + COLORMODE_HAM6)
  190.  
  191. #define    PIXFMT_0RGB_32        ((1L << PIXFMTB_RGB) + 0)
  192.  
  193.  
  194. /************************************************************************
  195.  
  196.     ExtractPalette return codes
  197.  
  198.     You must at least check for EXTP_SUCCESS.
  199.     EXTP_NO_DATA indicates that there was no histogram
  200.     or that there were no colors inside the histogram.
  201.  
  202. ************************************************************************/
  203.  
  204. #define    EXTP_SUCCESS            0
  205. #define    EXTP_NOT_ENOUGH_MEMORY    1
  206. #define    EXTP_CALLBACK_ABORTED    2
  207. #define    EXTP_NO_DATA            3
  208.  
  209.  
  210. /************************************************************************
  211.  
  212.     AddRGB, AddRGBImage and AddChunkyImage return codes
  213.  
  214.     You must at least check for ADDH_SUCCESS.
  215.     If not delivered, the histogram might be
  216.     inaccurate.
  217.  
  218. ************************************************************************/
  219.  
  220. #define    ADDH_SUCCESS                0
  221. #define    ADDH_NOT_ENOUGH_MEMORY        1
  222. #define    ADDH_CALLBACK_ABORTED        2
  223. #define ADDH_NO_DATA                3
  224.  
  225.  
  226. /************************************************************************
  227.  
  228.     Render return codes
  229.  
  230.     You must at least check for REND_SUCCESS.
  231.     If not delivered, there's no completely
  232.     rendered image.
  233.  
  234. ************************************************************************/
  235.  
  236. #define    REND_SUCCESS                0
  237. #define    REND_NOT_ENOUGH_MEMORY        1
  238. #define    REND_CALLBACK_ABORTED        2
  239. #define    REND_NO_VALID_PALETTE        3
  240.  
  241.  
  242. /************************************************************************
  243.  
  244.     SortPalette return codes
  245.  
  246.     You must at least check for SORTP_SUCCESS.
  247.     SORTP_NO_DATA indicates that there were data missing,
  248.     e.g. you specified no histogram or the histogram was empty.
  249.  
  250. ************************************************************************/
  251.  
  252. #define    SORTP_SUCCESS                0
  253. #define    SORTP_NO_DATA                1
  254. #define    SORTP_NOT_ENOUGH_MEMORY        2
  255.  
  256.  
  257. /************************************************************************
  258.  
  259.     conversion return codes
  260.  
  261.     These return codes apply to conversion functions
  262.     such as Chunky2RGB.
  263.  
  264. ************************************************************************/
  265.  
  266. #define    CONV_SUCCESS                0
  267. #define    CONV_CALLBACK_ABORTED        1
  268.  
  269.  
  270. /***********************************************************************/
  271.  
  272. #endif
  273.